import {Column, Entity, Index, PrimaryGeneratedColumn} from "typeorm";

@Index("idx_table_data_id", ["tableName", "tableDataId"], {})
@Entity("approval_notify", { schema: "workflow" })
export class ApprovalNotify {
    @Column("char", { primary: true, name: "id", length: 36 })
    @PrimaryGeneratedColumn("uuid")
    id: string;

    @Column("tinyint", {
        name: "status",
        nullable: true,
        comment: " 通知状态（0，未查阅，1已查阅）",
        default: () => "'0'",
    })
    status: number | null;

    @Column("tinyint", {
        name: "notify_type",
        nullable: true,
        comment: "消息类型（1同意 2拒绝）",
        default: () => "'0'",
    })
    notifyType: number | null;

    @Column("varchar", { name: "table_name", comment: "表名", length: 50 })
    tableName: string;

    @Column("char", { name: "table_data_id", comment: "数据id", length: 36 })
    tableDataId: string;

    @Column("char", {
        name: "user_id",
        nullable: true,
        comment: "发起用户id",
        length: 36,
    })
    userId: string | null;

    @Column("varchar", {
        name: "comment_content",
        nullable: true,
        comment: "通知内容",
        length: 255,
    })
    commentContent: string | null;

    @Column("varchar", {
        name: "create_by",
        nullable: true,
        comment: "创建人",
        length: 50,
    })
    createBy: string | null;

    @Column("datetime", {
        name: "create_time",
        nullable: true,
        comment: "创建日期",
    })
    createTime: Date | null;

    @Column("varchar", {
        name: "update_by",
        nullable: true,
        comment: "更新人",
        length: 50,
    })
    updateBy: string | null;

    @Column("datetime", {
        name: "update_time",
        nullable: true,
        comment: "更新日期",
    })
    updateTime: Date | null;
}
